from django.conf.urls.defaults import *

from django.views.generic.simple import direct_to_template, redirect_to
from django.core.urlresolvers import reverse
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^api/', include('fluffyshare.api.urls')),
    url(r'^register$', 'fluffyshare.provider.views.register', name='register_provider'),
    url(r'^send_file_list$', 'fluffyshare.provider.views.send_file_list'),
    url(r'^file_list$', 'fluffyshare.provider.views.get_file_list'),
    url(r'^remote/(?P<address>.*?)/(?P<filename>.*)/$', 'fluffyshare.provider.views.get_remote_file'),
    url(r'^login$', 'fluffyshare.provider.views.login'),
    url(r'^logout$', 'fluffyshare.provider.views.logout'),
    

    # Uncomment the admin/doc line below to enable admin documentation:
    (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    (r'^$', 'fluffyshare.provider.views.index'),
)

from django.conf import settings

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
            'show_indexes': True
        }))
